import { createApp } from 'vue'
import { createRouter, createWebHistory } from 'vue-router'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

// 导入路由配置
const routes = [
  {
    path: '/',
    name: 'home',
    component: () => import('./views/Home.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('./views/Login.vue')
  },
  {
    path: '/user',
    name: 'user',
    component: () => import('./views/user/UserList.vue')
  },
  {
    path: '/user/add',
    name: 'user-add',
    component: () => import('./views/user/UserAdd.vue')
  },
  {
    path: '/user/edit/:id',
    name: 'user-edit',
    component: () => import('./views/user/UserEdit.vue')
  },
  {
    path: '/message',
    name: 'message',
    component: () => import('./views/message/MessageList.vue')
  },
  {
    path: '/message/add',
    name: 'message-add',
    component: () => import('./views/message/MessageAdd.vue')
  },
  {
    path: '/message/edit/:id',
    name: 'message-edit',
    component: () => import('./views/message/MessageEdit.vue')
  },
  {
    path: '/heritage',
    name: 'heritage',
    component: () => import('./views/heritage/HeritageList.vue')
  },
  {
    path: '/heritage/add',
    name: 'heritage-add',
    component: () => import('./views/heritage/HeritageAdd.vue')
  },
  {
    path: '/heritage/edit/:id',
    name: 'heritage-edit',
    component: () => import('./views/heritage/HeritageEdit.vue')
  },
  {
    path: '/architecture',
    name: 'architecture',
    component: () => import('./views/architecture/ArchitectureList.vue')
  },
  {
    path: '/architecture/add',
    name: 'architecture-add',
    component: () => import('./views/architecture/ArchitectureAdd.vue')
  },
  {
    path: '/architecture/edit/:id',
    name: 'architecture-edit',
    component: () => import('./views/architecture/ArchitectureEdit.vue')
  },
  {
    path: '/legal',
    name: 'legal',
    component: () => import('./views/legal/LegalConsultList.vue')
  },
  {
    path: '/legal/add',
    name: 'legal-add',
    component: () => import('./views/legal/LegalConsultAdd.vue')
  },
  {
    path: '/legal/edit/:id',
    name: 'legal-edit',
    component: () => import('./views/legal/LegalConsultEdit.vue')
  },
  {
    path: '/donation',
    name: 'donation',
    component: () => import('./views/donation/DonationList.vue')
  },
  {
    path: '/donation/add',
    name: 'donation-add',
    component: () => import('./views/donation/DonationAdd.vue')
  },
  {
    path: '/donation/edit/:id',
    name: 'donation-edit',
    component: () => import('./views/donation/DonationEdit.vue')
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

const app = createApp(App)
app.use(router)
app.use(ElementPlus)
app.mount('#app')
